package com.summer.authentication.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.summer.authentication.pojo.XcUser;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Mr.Chen
 * @since 2023-07-06
 */
public interface XcUserMapper extends BaseMapper<XcUser> {

    @Select("select xc_menu.code\n" +
            "from xc_menu\n" +
            "         left join xc_permission xp on xc_menu.id = xp.menu_id\n" +
            "         left join xc_user_role xur on xur.role_id = xp.role_id\n" +
            "where xur.user_id = #{userId};")
    List<String> getPermissionByUid(String userId);
}
